#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
@Project : gtmsAutoTestProject 
@File    : printer_manage_api.py
@IDE     : PyCharm 
@Author  : Mario
@Date    : 2022/4/26 16:53 
@Describe: 中台打印管理相关接口
"""
from Comm.tools.toolsControl import ToolsHandler
from APIs.middleApi.base_middle_api import BaseMiddleApi


class PrintManagerApi(BaseMiddleApi):
    def __init__(self, environment):
        super().__init__(environment)

    def pos_printer_manage_page(self, brandCode, pageNum='1', pageSize='100'):
        """
        打印机管理分页
        :param brandCode: 品牌编码
        :param pageNum: 第几页，默认1
        :param pageSize: 每页展示几条，默认100
        :return:
        """
        shopCode = ToolsHandler.get_shopCode(brandCode)
        payload = '{"pageNum":"' + pageNum + '","pageSize":"' + pageSize + '","brandCode":"' + brandCode + '","shopCodes":["' + shopCode + '"]} '
        response = self.http_requests('catering-backend/pos/printer/manage/page', payload)
        return response


if __name__ == '__main__':
    test = PrintManagerApi('sit')
    test.pos_printer_manage_page('823882')
